<?php

App::uses('Controller', 'ApiAppController');

class ApiController extends ApiAppController {
	
	public function beforeFilter() {
		parent::beforeFilter();
	}
	
	public function spots_listing() {
		$defaults = array (
			'limit' => 5,
		);
		$options = array_merge($defaults, $this->request->query);
		$spots = $this->Spot->find('all', $options);
		$this->set('spots', $spots);
		$this->set('_serialize', array('spots'));
	}
	
	public function cities_listing() {
		$defaults = array (
			'limit' => 0,
		);
		$options = array_merge($defaults, $this->request->query);
		$cities = $this->City->find('list', $options);
		$this->set('cities', $cities);
		$this->set('_serialize', array('cities'));
	}
	
}

